package cn.chaos.bio01;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.logging.Logger;

public class CompressServer {

    public static void main(String[] args) throws IOException {
        
        int port = 11111;
        
        ServerSocket serverSocket = new ServerSocket(port);
        
        Logger logger = Logger.getLogger("practial");
        
        Executor service = Executors.newCachedThreadPool();
        
        while (true) {
            Socket clientSocket = serverSocket.accept();
            service.execute(new CompressProtocol(clientSocket, logger));
        }
    }
}
